#! /usr/bin/env python
#coding=utf-8


import rospy
from turtlesim.srv import *


if __name__=="__main__":

    rospy.init_node("set_turtle_p")

    client = rospy.ServiceProxy("/spawn",Spawn)

    client.wait_for_service()

    req = SpawnRequest()

    req.x = 2.0

    req.y = 2.0

    req.theta = 3.0

    req.name = "my_turtle_p"
    try:
        response = client.call(req)

        rospy.loginfo("龟龟创建成功！叫%s",response.name)
    except expression as identifier:
        rospy.loginfo("服务调用失败")